package test;

import java.util.Scanner;
import java.util.TreeSet;

public class Main2 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		TreeSet<String> set = new TreeSet<String>();
		while (sc.hasNext()) {
			String str = sc.next();
			if (str.equals("!!!!!"))
				break;
			set.add(str);
		}
		System.out.println(set.size());
		String[] strs = new String[set.size()];
		set.toArray(strs);
		for (int i = 0; i < 10 && i < strs.length; i++) {
			System.out.println(strs[i]);
		}
	}

}
